// Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
// This source file is part of the Cangjie project, licensed under Apache-2.0
// with Runtime Library Exception.
//
// See https://cangjie-lang.cn/pages/LICENSE for license information.

#ifndef CANGJIE_MIGRATOR_DEVECO_CJPMRUNPARAMETER
#define CANGJIE_MIGRATOR_DEVECO_CJPMRUNPARAMETER

#include <vector>
#include <string>

#include "Platform/EnvironmentVariable.h"

#include "Deveco/Log.h"

namespace CangjieMigrator::Deveco {

class CjpmRunParameter {
public:
    static const CjpmRunParameter EMPTY;

    std::string name;

    std::vector<Platform::EnvironmentVariable> environment;
    std::string command;
    bool success;

    explicit CjpmRunParameter(std::string name, std::vector<Platform::EnvironmentVariable> environment, std::string command, bool success);

    [[nodiscard]] bool IsValid() const;

    static std::vector<CjpmRunParameter> ParseFromLogs(const std::vector<Log> &logs);
};

} // namespace CangjieMigrator::Deveco

#endif // CANGJIE_MIGRATOR_DEVECO_CJPMRUNPARAMETER
